package com.wangzhip.app;

import com.wangzhip.bean.CarttoonCatAndMouseAutoConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;

@SpringBootApplication
@Import(CarttoonCatAndMouseAutoConfig.class)
public class App {

    public static void main(String[] args) {

//        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext2.xml");
//        Object cat = ctx.getBean("cat");

        ConfigurableApplicationContext run = SpringApplication.run(App.class);
        CarttoonCatAndMouseAutoConfig bean = run.getBean(CarttoonCatAndMouseAutoConfig.class);
        bean.play();
    }
}
